package org.tr.demo.clock;

import javax.swing.*;
import java.awt.*;

///////////////////////////////////////////////////////////// org.tr.demo.clock.ClockAnalogBuf
public class ClockAnalogBuf extends JApplet {
    
    //=============================================================== fields
    //private org.tr.demo.clock.AnalogClock analogClock;                        // Our clock component.
    private DigitalClock digitalClock;                        // Our clock component.
    
    //================================================================= main

    
    public static void main(String[] args) {
        JFrame window = new JFrame();
        window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        window.setTitle("Digital Clock");
        window.setSize(300, 300);
        window.setLocation(100, 100);
        //window.setLocation(500, 500);
        window.setContentPane(new ClockAnalogBuf());        
        window.pack();                          // Layout components
        //window.setLocationRelativeTo(null);     // Center window.
        window.setVisible(true);
    }
    
    //========================================================== constructor
    public ClockAnalogBuf() {
        //... Create an instance of our new clock component.
    	//analogClock = new org.tr.demo.clock.AnalogClock();
    	digitalClock = new DigitalClock();
        
        //... Set the applet's layout and add the clock to it.
        setLayout(new BorderLayout());
        //add(analogClock, BorderLayout.CENTER);
        add(digitalClock, BorderLayout.SOUTH);
        
        //... Start the clock running.
        start(); 
    }
    
    //=============================================================== start
    @Override public void start() {
    	//analogClock.start();
    	digitalClock.start();
    }
    
    //================================================================ stop
    @Override public void stop() {
    	//analogClock.stop();
    	digitalClock.stop();
    }
}
